home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / lib / empire.g < prev    next >
Text File  |  1995-05-04  |  14KB  |  500 lines

  1. (game-module "empire"
  2.   (title "Empire")
  3.   (blurb "The classic big economic/military game")
  4.   (variants
  5.    (see-all true)
  6.    ("Only One Winner" wipeout true (true (scorekeeper (do last-side-wins))))
  7.    ("More Starters" more-starters true
  8.      (true
  9.       (add harbor start-with 1)
  10.       )
  11.      )
  12.    )
  13.   )
  14.  
  15. (unit-type infantry (image-name "infantry"))
  16. (unit-type motor-infantry (image-name "infantry"))
  17. (unit-type mech-infantry (image-name "infantry"))
  18. (unit-type marines (image-name "infantry"))
  19. (unit-type security (image-name "infantry"))
  20. (unit-type cavalry (image-name "cavalry"))
  21. (unit-type light-armor (image-name "tank"))
  22. (unit-type armor (image-name "tank"))
  23. (unit-type heavy-armor (image-name "tank"))
  24. (unit-type artillery (image-name "artillery"))
  25. (unit-type light-artillery (image-name "artillery"))
  26. (unit-type heavy-artillery (image-name "artillery"))
  27. (unit-type mech-artillery (image-name "artillery"))
  28. (unit-type aa (image-name "flak"))
  29. (unit-type supply (image-name "truck"))
  30. (unit-type engineers (image-name "engineers"))
  31. (unit-type mech-engineers (image-name "engineers"))
  32. (unit-type mobile-radar (image-name "radar"))
  33.  
  34. (define infantry-types (infantry motor-infantry mech-infantry marines security))
  35.  
  36. (define armor-types (light-armor armor heavy-armor))
  37.  
  38. (define artillery-types (artillery light-artillery heavy-artillery mech-artillery aa))
  39.  
  40. (define ground-types
  41.   (append infantry-types cavalry armor-types artillery-types
  42.    supply engineers mech-engineers mobile-radar
  43.    ))
  44.  
  45. (add ground-types acp-per-turn 2)
  46.  
  47. (unit-type fishing-boat (image-name "ap"))
  48.  
  49. (unit-type cargo-ship (image-name "ap"))
  50. (unit-type tanker (image-name "ap"))
  51. (unit-type ore-ship (image-name "ap"))
  52. (unit-type slave-ship (image-name "ap"))
  53.  
  54. (unit-type landing-craft (image-name "dd"))
  55.  
  56. (unit-type torpedo-boat (image-name "dd"))
  57. (unit-type destroyer (image-name "dd"))
  58. (unit-type frigate (image-name "dd"))
  59. (unit-type light-cruiser (image-name "ca"))
  60. (unit-type heavy-cruiser (image-name "ca"))
  61. (unit-type battleship (image-name "bb"))
  62.  
  63. (unit-type light-carrier (image-name "cv"))
  64. (unit-type escort-carrier (image-name "cv"))
  65. (unit-type carrier (image-name "cv"))
  66. (unit-type missile-frigate (image-name "dd"))
  67. (unit-type missile-cruiser (image-name "ca"))
  68.  
  69. (unit-type submarine (image-name "sub"))
  70. (unit-type asw-cruiser (image-name "ca"))
  71. (unit-type minesweeper (image-name "ap"))
  72.  
  73. (define production-ship-types (fishing-boat))
  74.  
  75. (define material-transport-ship-types (cargo-ship tanker ore-ship slave-ship))
  76.  
  77. (define transport-ship-types (landing-craft))
  78.  
  79. (define surface-combat-ship-types
  80.   (torpedo-boat destroyer frigate light-cruiser heavy-cruiser battleship))
  81.  
  82. (define air-combat-ship-types
  83.   (light-carrier escort-carrier carrier missile-frigate missile-cruiser))
  84.  
  85. (define ship-types
  86.   (append production-ship-types material-transport-ship-types
  87.    transport-ship-types surface-combat-ship-types air-combat-ship-types
  88.    submarine asw-cruiser minesweeper
  89.    ))
  90.  
  91. (add ship-types acp-per-turn 4)
  92.  
  93. (unit-type fighter-1 (image-name "fighter"))
  94. (unit-type fighter-2 (image-name "fighter"))
  95. (unit-type escort (image-name "fighter"))
  96. (unit-type naval-fighter (image-name "fighter"))
  97. (unit-type light-bomber (image-name "4e"))
  98. (unit-type medium-bomber (image-name "4e"))
  99. (unit-type heavy-bomber (image-name "4e"))
  100. (unit-type transport (image-name "4e"))
  101. (unit-type attack-helicopter (image-name "helicopter"))
  102. (unit-type transport-helicopter (image-name "cargo-chopper"))
  103. (unit-type recon-plane (image-name "4e"))
  104. (unit-type asw-plane (image-name "4e"))
  105. (unit-type missile (image-name "missile"))
  106. (unit-type icbm (image-name "icbm"))
  107. (unit-type sam (image-name "missile"))
  108. (unit-type abm (image-name "missile"))
  109.  
  110. (define fighter-plane-types (fighter-1 fighter-2 escort naval-fighter))
  111.  
  112. (define missile-types (missile icbm sam abm))
  113.  
  114. (define plane-types
  115.   (append fighter-plane-types
  116.    light-bomber medium-bomber heavy-bomber
  117.    transport
  118.    attack-helicopter transport-helicopter
  119.    recon-plane asw-plane
  120.    missile-types
  121.    ))
  122.  
  123. (add plane-types acp-per-turn 8)
  124.  
  125. (add missile-types acp-per-turn 1)
  126.  
  127. (unit-type small-nuke (image-name "bomb"))
  128. (unit-type medium-nuke (image-name "bomb"))
  129. (unit-type large-nuke (image-name "bomb"))
  130.  
  131. (define nuke-types (small-nuke medium-nuke large-nuke))
  132.  
  133. (add nuke-types acp-per-turn 1)
  134.  
  135. ;; The remaining types are actually "sector types" in Empire, but
  136. ;; they work better as cell-filling unit types in Xconq.
  137.  
  138. (unit-type bridge (image-name "bridge")
  139.   (help "allows ground units to be over water"))
  140. (unit-type radar (image-name "radar") (char ")")
  141.   (help "fixed radar station - has a long-range view"))
  142. (unit-type mines (image-name "minefield")
  143.   (help "useful for blocking land and sea passages"))
  144.  
  145. (define inert-types (bridge radar mines))
  146.  
  147. (add inert-types acp-per-turn 0)
  148.  
  149. (unit-type agribusiness (image-name "farm") (char "a"))
  150. (unit-type oil-field (image-name "oil-derrick") (char "o"))
  151. (unit-type oil-platform (image-name "oil-derrick"))
  152. (unit-type mine (image-name "iron-mine") (char "m"))
  153. (unit-type gold-mine (image-name "gold-mine") (char "g"))
  154. (unit-type uranium-mine (image-name "uranium-mine") (char "u"))
  155.  
  156. (unit-type technical-center (image-name "facility") (char "t"))
  157. (unit-type fortress  (image-name "facility") (char "f"))
  158. (unit-type research-lab (image-name "facility") (char "r"))
  159. (unit-type nuclear-plant (image-name "facility") (char "n"))
  160. (unit-type library/school (image-name "facility") (char "l"))
  161. (unit-type enlistment (image-name "facility") (char "e"))
  162. (unit-type headquarters (image-name "facility") (char "!"))
  163.  
  164. (unit-type harbor (image-name "port") (char "h"))
  165. (unit-type airfield (image-name "airbase") (char "*"))
  166. (unit-type refinery (image-name "facility") (char "%"))
  167. (unit-type lcm-factory (image-name "facility") (char "j"))
  168. (unit-type hcm-factory (image-name "facility") (char "k"))
  169. (unit-type defense-plant (image-name "facility") (char "d"))
  170. (unit-type shell-industry (image-name "facility") (char "i"))
  171. (unit-type warehouse (image-name "facility") (char "w"))
  172.  
  173. (unit-type bank (image-name "bank") (char "b"))
  174.  
  175. (define facility-types
  176.   (agribusiness oil-field oil-platform mine gold-mine uranium-mine
  177.    bank
  178.    technical-center fortress research-lab nuclear-plant library/school enlistment headquarters
  179.    harbor airfield refinery lcm-factory hcm-factory defense-plant shell-industry warehouse))
  180.  
  181. (add facility-types acp-per-turn 1)
  182.  
  183. (unit-type capital (image-name "city20") (char "c")
  184.   (help "center of the country"))
  185.  
  186. (add capital acp-per-turn 3)
  187.  
  188. ;; Hit points are like effectiveness.
  189.  
  190. (add u* hp-max 100)
  191.  
  192. (material-type food (notes #|long-name|# "food"))
  193. (material-type sh (notes #|long-name|# "shell"))
  194. (material-type gun (notes #|long-name|# "guns"))
  195. (material-type pet (notes #|long-name|# "petroleum"))
  196. (material-type iron (notes #|long-name|# "iron ore"))
  197. (material-type dust (notes #|long-name|# "gold dust"))
  198. (material-type oil (notes #|long-name|# "crude oil"))
  199. (material-type lcm (notes #|long-name|# "light construction materials"))
  200. (material-type hcm (notes #|long-name|# "heavy construction materials"))
  201. (material-type rad (notes #|long-name|# "rads"))
  202. ; also education and happiness here?
  203. (material-type civ (notes #|long-name|# "civilians"))
  204. (material-type mil (notes #|long-name|# "military"))
  205. (material-type uw (notes #|long-name|# "uncompensated workers")
  206.   (help "slaves, really"))
  207. (material-type gold (notes #|long-name|# "gold"))
  208.  
  209. (define raw (iron dust oil rad))
  210. (define manufactures (food sh gun pet lcm hcm gold))
  211. (define peoples (civ mil uw))
  212.  
  213. (add peoples people 1)
  214.  
  215. (terrain-type sea (char "."))
  216. (terrain-type settled (image-name "clear") (char "-"))
  217. (terrain-type wilderness (image-name "forest") (char "-"))
  218. (terrain-type mountains (char "^"))
  219. (terrain-type wasteland (char "/")
  220.   (help "uninhabitable due to radioactivity"))
  221. (terrain-type highway (image-name "road") (char "+")
  222.   (subtype connection))
  223.  
  224. (define land (settled wilderness mountains wasteland highway))
  225.  
  226. ;;; Static relationships.
  227.  
  228. ;; Unit vs unit.
  229.  
  230. (table unit-capacity-x
  231.   ;; Engineers can get inside most anything.
  232.   (facility-types (engineers mech-engineers) 1)
  233.   (headquarters ground-types 8)
  234.   (harbor ship-types 8)
  235.   (airfield plane-types 8)
  236.   (capital ground-types 2)
  237.   (capital ship-types 8)
  238.   (capital plane-types 8)
  239.   )
  240.  
  241. ;; Unit vs terrain.
  242.  
  243. (table vanishes-on
  244.   (ground-types sea true)
  245.   (ship-types land true)
  246.   (facility-types sea true)
  247.   (capital sea true)
  248.   ;; Bridges and oil platforms can only be placed in sea cells.
  249.   ((bridge oil-platform) sea false)
  250.   ((bridge oil-platform) land true)
  251.   ;; Units normally die in wasteland.
  252.   (u* wasteland true)
  253.   ;; Planes can fly over wasteland safely.
  254.   (plane-types wasteland false)
  255. )
  256.  
  257. (add t* capacity 16)
  258.  
  259. (table unit-size-in-terrain
  260.   (u* t* 1)
  261.   (facility-types t* 16)
  262.   (capital t* 16)
  263.   )
  264.  
  265. (table terrain-storage-x
  266.   ;; Room for raw materials
  267.   (t* oil 100)
  268.   (t* iron 100)
  269.   (t* dust 10)
  270.   (t* rad 10)
  271.   ;; Room for peoples
  272.   (settled peoples 999)
  273.   )
  274.  
  275. (table unit-storage-x
  276.   (ground-types food 10)
  277.   (artillery-types sh 100)
  278.   (ground-types mil 1)
  279.   (ship-types food 100)
  280.   ;; Special-function ships.
  281.   (fishing-boat food 200)
  282.   (tanker oil 100)
  283.   (ore-ship iron 100)
  284.   (cargo-ship (sh gun lcm hcm) 100)
  285.   (facility-types food 30)
  286.   (facility-types civ 10)
  287.   ;; Special-function facilities
  288.   (agribusiness food 150)
  289.   (ground-types pet 10)
  290.   (ship-types pet 100)
  291.   ;; Warehouses have lots of room, but only for manufactured goods.
  292.   (warehouse manufactures 999)
  293.   ;; Everything centers on the capital.
  294.   (capital m* 999)
  295.   )
  296.  
  297. ;;; (really need generic capacities for cargo ships)
  298.  
  299. ;;; Actions.
  300.  
  301. (table material-to-act
  302.   ;; Ground units need soldiers to run them.
  303.   (ground-types mil 1)
  304.   ;; Facilities all need civilians to run them.
  305.   (facility-types civ 1)
  306.   )
  307.  
  308. ;;; Movement.
  309.  
  310. (add missile-types speed 30.00)
  311.  
  312. (add inert-types speed 0)
  313. (add facility-types speed 0)
  314. (add capital speed 0)
  315.  
  316. ;;; Construction.
  317.  
  318. (add u* cp 6)
  319.  
  320. (table acp-to-create
  321.   (engineers bridge 1)
  322.   (engineers facility-types 1)
  323.   (headquarters ground-types 1)
  324.   (harbor ship-types 1)
  325.   (airfield plane-types 1)
  326.   (capital engineers 1)
  327.   )
  328.  
  329. (table cp-on-creation
  330.   (engineers bridge 1)
  331.   (engineers facility-types 1)
  332.   (headquarters ground-types 1)
  333.   (harbor ship-types 1)
  334.   (airfield plane-types 1)
  335.   (capital engineers 1)
  336.   )
  337.  
  338. (table acp-to-build
  339.   (engineers bridge 1)
  340.   (engineers facility-types 1)
  341.   (headquarters ground-types 1)
  342.   (harbor ship-types 1)
  343.   (airfield plane-types 1)
  344.   (capital engineers 1)
  345.   )
  346.  
  347. (table cp-per-build
  348.   (engineers bridge 1)
  349.   (engineers facility-types 1)
  350.   (headquarters ground-types 1)
  351.   (harbor ship-types 1)
  352.   (airfield plane-types 1)
  353.   (capital engineers 1)
  354.   )
  355.  
  356. ;; need pet/lcm/hcm to build things also.
  357.  
  358. ;;; Production (and consumption).
  359.  
  360. (table base-production
  361.   ((agribusiness fishing-boat capital) food (100 50 20))
  362.   ((oil-field oil-platform) oil 1)  ;  should be extraction really
  363.   ((enlistment capital) mil 1)
  364.   (capital civ 1)
  365.   (refinery pet 1)
  366.   )
  367.  
  368. (table base-consumption
  369.   ;; Everything eats food.
  370.   (u* food 1)
  371.   (agribusiness food 0) ; a hack
  372.   ;; Capital is self-supporting, but has no excess.
  373.   (capital food 20)
  374.   ;; Most hardware eats petroleum products.
  375.   (ship-types pet 1)
  376.   (plane-types pet 1)
  377.   ;; Inert types don't consume anything at all.
  378.   (inert-types m* 0)
  379.   )
  380.  
  381. (table hp-per-starve
  382.   ;; Going without food is potentially deadly.
  383.   (u* food 1.00)
  384.   ;; Technology types really need their petroleum products.
  385.   (ship-types pet 1.00)
  386.   (plane-types pet 1.00)
  387.   )
  388.  
  389. (table out-length
  390.   ;; Farming has a default supply infrastructure.
  391.   (agribusiness food 5)
  392.   ;; Fishing fleets must rely on land systems to redistribute.
  393.   (fishing-boat food 1)
  394.   ;; The oil business' support machinery can get the oil sent around.
  395.   (oil-field oil 5)
  396.   (oil-platform oil 5)
  397.   ;; Civilians will tend to go where they're needed (looking for jobs).
  398.   (facility-types civ 2)
  399.   ;; Warehouses are redistribution points.
  400.   (warehouse m* 5)
  401.   ;; Capital will be generous with nearby needy units.
  402.   (capital m* 2)
  403.   )
  404.  
  405. (table in-length
  406.   ;; Every type of unit that needs food can get it from an adjacent cell.
  407.   (u* food 1)
  408.   ;; Civilians will tend to go where they're needed (looking for jobs).
  409.   (facility-types civ 2)
  410.   ;; Warehouses are redistribution points.
  411.   (warehouse m* 5)
  412.   ;; The capital always gets special service if it needs something.
  413.   (capital m* 5)
  414.   )
  415.  
  416. ;;; Combat.
  417.  
  418. (table hit-chance
  419.   (infantry-types facility-types 100)
  420.   (infantry-types fortress 50)
  421.   (infantry-types capital 100)
  422.   )
  423.  
  424. (table damage
  425.   (infantry-types facility-types 1)
  426.   (infantry-types capital 1)
  427.   )
  428.  
  429. (table capture-chance
  430.   ;; Most facilities can't prevent their own capture.
  431.   (infantry-types facility-types 100)
  432.   ;; Fortresses are tough.
  433.   (infantry-types fortress 10)
  434.   (infantry-types capital 50)
  435.   (armor-types capital 70)
  436.   )
  437.  
  438. ;; Nuclear detonation results in the destruction of units and the
  439. ;; creation of wasteland.
  440.  
  441. (add nuke-types acp-to-detonate 1)
  442.  
  443. ;;; Terrain alteration.
  444.  
  445. (table acp-to-add-terrain
  446.   (engineers settled 1)
  447.   (engineers highway 1)
  448.   )
  449.  
  450. (table acp-to-remove-terrain
  451.   (engineers wilderness 1)
  452.   )
  453.  
  454. ;;; Vision.
  455.  
  456. (add mobile-radar vision-range 6)
  457. (add radar vision-range 8)
  458.  
  459. ;;; Random setup.
  460.  
  461. ;;; Everybody starts with just the one capital.
  462.  
  463. (add capital start-with 1)
  464.  
  465. (add (sea settled wilderness mountains) alt-percentile-min (  0  70 70  95))
  466. (add (sea settled wilderness mountains) alt-percentile-max ( 70  75 95 100))
  467. (add t* wet-percentile-min 0)
  468. (add t* wet-percentile-max 100)
  469. (add settled wet-percentile-min 40)
  470. (add settled wet-percentile-max 60)
  471.  
  472. (table favored-terrain
  473.   (u* t* 0)
  474.   (capital settled 100)
  475.   )
  476.  
  477. ;; A game's starting units will be full by default.
  478.  
  479. (table unit-initial-supply (u* m* 9999))
  480.  
  481. (table terrain-initial-supply
  482.   (t* oil 100)
  483.   (t* iron 100)
  484.   (t* dust 1)  ; should be rare but high concentration randomly
  485.   (t* rad 1)
  486.   )
  487.  
  488. (set sides-min 1)
  489. (set sides-max 30)
  490.  
  491. (game-module (instructions (
  492.   "Build up your country and materials."
  493.   "If you can't live in peace with your neighbors,"
  494.   "then be prepared to fight with them."
  495.   )))
  496.  
  497. (game-module (design-notes (
  498.   "Scale is unimportant, this is an abstract game."
  499.   )))
  500.